package com.wkk.controller;

import com.wkk.entity.ConsoleInfo;
import com.wkk.entity.IncomeOneDay;
import com.wkk.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;


@Controller
public class AdminController {

    @Autowired
    private AdminService adminService;

    /**
     * 获取控制台 收入信息
     * @return
     */
    @ResponseBody
    @RequestMapping("getConsole")
    public ConsoleInfo getConsole(){
        return adminService.getConsoleInfo();
    }

    /**
     * 通过日期查询 收入占比
     * @param date
     * @return
     */
    @ResponseBody
    @RequestMapping("getIncomeByDate")
    public IncomeOneDay getIncomeByATime(@RequestParam(value = "date",required = false,defaultValue = "notUpload")String date){
        return adminService.getIncomeByATime(date);
    }


}
